package com.qfmy.mapper.novel;

import model.entity.novel.NovelSelf;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author 清风明月
 * @Package com.qfmy.mapper.novel
 * @date 2025/6/7
 * @description 书架
 */
@Mapper
@SuppressWarnings("all")
public interface NovelSelfMapper {

    /**
     * 获取书架
     * @param userId
     * @param start
     * @param size
     * @return
     */
    List<NovelSelf> getNovelSelf(Long userId, Integer start, Integer size);

    /**
     * 添加书架
     * @param novelSelf
     */
    void insert(NovelSelf novelSelf);

    /**
     * 删除小说
     * @param novelId
     * @param userId
     */
    @Delete("delete from novel_self where novel_id = #{novelId} and user_id = #{userId}")
    void deleteNovelSelf(int novelId, int userId);

}
